package yt.demo.appcorebasic.config;

import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
import yt.demo.appcorebasic.interceptor.SakInterceptor;

@Configuration
public class SaTokenConfigure implements WebMvcConfigurer {

    @Override
    public void addInterceptors(InterceptorRegistry registry) {
        registry.addInterceptor(new SakInterceptor())
                .addPathPatterns("/**")
                .excludePathPatterns(
                        "/error",
                        "/auth/login",   // 登录接口
                        "/auth/getMenu", // 获取菜单接口
                        "/file/**",  // 文件上传接口
                        "/uploads/**"

                        // 排除 uploads 路径
                );
    }
}
